const mongoose = require("mongoose");
const { mongopath } = require("../config/config.default");
const User = require('./User');
const verificationSchema = require('./Verification');
const Car = require('./Car');
const Order = require('./Order');
const Review = require('./Review');

async function main() {
    await mongoose.connect(mongopath);
}

main()
    .then(res => {
        console.log("MongoDB 连接成功");
    })
    .catch((err) => {
        console.log("MongoDB 连接失败:", err);
    });

module.exports = {
    User,
    Verification: mongoose.model('Verification', verificationSchema),
    Car,
    Order,
    Review
};